package gui;

import gui.panels.PanelMain;

import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.GroupLayout;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JScrollPane;
import javax.swing.ScrollPaneConstants;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JPanel;

public class TransEsc {

	private JFrame frmTransEsc;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					TransEsc window = new TransEsc();
					window.frmTransEsc.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public TransEsc() {
		initialize();
	}

	public void setBounds(int x, int y){

		Rectangle rectangle = new Rectangle();
		frmTransEsc.getBounds(rectangle);
		frmTransEsc.setBounds(rectangle.x, rectangle.y, x, y);

	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frmTransEsc = new JFrame();
		frmTransEsc.setResizable(false);
		//frmGitconf.setIconImage(Toolkit.getDefaultToolkit().getImage("E:\\ljcn\\workspace\\gitconf2\\icon.jpg"));
		frmTransEsc.setTitle("Transporte Escolar");
		frmTransEsc.setBounds(10, 100, 680, 460);
		frmTransEsc.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		//			frame.setMinimumSize(new Dimension(800, 600));

		JMenuBar menuBar = new JMenuBar();
		frmTransEsc.setJMenuBar(menuBar);

		JMenu mnSistema = new JMenu("Sistema");
		menuBar.add(mnSistema);

		JMenuItem mntmSair = new JMenuItem("Sair");
		mntmSair.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				System.exit(0);
			}
		});
		mnSistema.add(mntmSair);

		JMenu mnFichas = new JMenu("Fichas");
		menuBar.add(mnFichas);
		
		JPanel panel_1 = new JPanel();
		frmTransEsc.getContentPane().add(panel_1, BorderLayout.NORTH);
		
				PanelMain panel = new PanelMain(this);
				panel_1.add(panel);
				
				panel.setMainFrame(frmTransEsc);
				GroupLayout gl_panel = new GroupLayout(panel);
				gl_panel.setHorizontalGroup(
					gl_panel.createParallelGroup(Alignment.LEADING)
						.addGap(0, 680, Short.MAX_VALUE)
				);
				gl_panel.setVerticalGroup(
					gl_panel.createParallelGroup(Alignment.LEADING)
						.addGap(0, 460, Short.MAX_VALUE)
				);
				panel.setLayout(gl_panel);

	}
}

